#ifndef NODE_H_INCLUDED
#define NODE_H_INCLUDED
struct CONTENT {
    string name;//名称
    string nickname;//别名
    unsigned int num;//已搜索到的次数
    CONTENT();
    };
CONTENT::CONTENT() {
    num=0;
    }

bool content_equal(const CONTENT &left, const CONTENT &right);
bool descending( const CONTENT &left, const CONTENT &right);

bool content_equal(const CONTENT &left, const CONTENT &right) {
    return (left.name==right.name)&&(left.nickname==right.nickname)&&(left.num==right.num);
    }


bool descending( const CONTENT &left, const CONTENT &right) {//降序排列
    return (left.nickname.find(right.nickname)!=string::npos||left.num > right.num);
    }

typedef struct Node {
    string name;    //节点名称
    string path;    //文件路径
    string varcode; //变量位序
    string tag;    //搜索顺序
    vector<CONTENT> feature;    //节点特征词集合
    vector<CONTENT> value;    //节点值集合
    bool tag_continue;  //  0：不查询该节点下的其他节点
    unsigned int num;  //  0：在该子树下已找到标签的个数
    unsigned int num_total;  //所有请求中该节点下搜索到的次数

    Node* father;
    Node* son;
    Node* brother;

    Node(); //构造函数

    } NODE,*PNODE;

Node::Node() {
    tag_continue=1;
    num=num_total=0;
    father=son=brother=NULL;
    tag="999";
    }








#endif // NODE_H_INCLUDED
